home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / gzip 1.2.2 / cextras-1.0 / atest.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-08  |  1.0 KB  |  43 lines  |  [TEXT/MPS ]

  1. /*
  2.     atest.c -- test the function of alloca.
  3.  
  4.     Copyright (c) 1993 Anthony C. Ard.
  5.  
  6.     This program is free software; you can redistribute it and/or
  7.     modifiy it under the terms of the GNU General Public License
  8.     as published by the Free Software Foundation; either version 2
  9.     of the License, or (at your option) any later version.
  10.     
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14.     GNU General Public License for more details.
  15.     
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #include <StdLib.h>
  22. #include <String.h>
  23. #include "alloca.h"
  24.  
  25. void flubflub( void )
  26. {
  27.     char *thePtr;
  28.     
  29.     thePtr = (char *)alloca( 1000 );
  30.     
  31.     strcpy( thePtr, "This is a test." );
  32.     
  33.     printf( "Here it is --> %s\n", thePtr );
  34. }
  35.  
  36.  
  37. int main( void )
  38. {
  39.     flubflub();
  40.  
  41.     return 1;
  42. }
  43.